import React from 'react'
import style from './style.module.scss'
import { getTimeFormatText } from '../../utils/formatTime';
import { useNavigate } from 'react-router-dom';

interface PropsType {
  infoId: string,
  thumbnail: string[],
  title: string,
  doctor: string,
  createTime: number
}

export const MyThumbnail1: React.FC<PropsType> = ({ infoId, thumbnail, title, doctor, createTime }) => {

  const navigate = useNavigate()

  return (
    <div
      className={style.collectionConent_item}
      key={infoId}
      onClick={() => navigate(`/home/information/${infoId}`)}
    >
      <div className={style.aPicture}>
        <div className={style.aPicture_left}>
          {thumbnail.map((v, i) => {
            return <img src={v} alt="" key={i} />;
          })}
        </div>
        <div className={style.aPicture_right}>
          <div>{title}</div>
          <div className={style.doctor_createTime}>
            <div>{doctor}</div>
            <div>{getTimeFormatText(new Date(createTime))}</div>
          </div>
        </div>
      </div>
    </div>
  )

}
